Skip to content

id(range-sync): refuse entry upper bounds over KEY_LEN at frames() and check_bounds (#2595) - #3462

Merged
dezren39 merged 1 commit into
mainfrom
queue/5390-2595-range-bound
Nov 1, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/5390-2595-range-bound

Conversation

@dezren39

@dezren39 dezren39 commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Fixes #2595 — implementation of the gate pinned by triage task 3842 (queue task 5390).

encode_entry wrote an entry upper bound's length as b.len() as u8 with no KEY_LEN (72) check: bounds of 73..=255 encoded into frames decode_frame itself rejects, bounds ≥ 256 wrapped the length byte and garbled the entry stream, and check_bounds approved them all.

  • One shared check_bound_len gate in pkgs/id/src/event_store/range.rs — refuses a bound longer than KEY_LEN with an error naming the bound length and the 72-byte limit, following the decoder's wording in Reader::entry.
  • Called from frames() per entry (before encoding) and from check_bounds() per bound.
  • New test test_bounds_over_key_len_are_refused_at_both_gates: a 72-byte bound round-trips through a frame; 73/100/255/256/300 are refused at both gates (the frames error names the length — no wrap).

Decoder-side handling, varint canonical form, and sync.rs budgets are untouched, per the packet's scope.

🤖 Agent note · PR opened by queue worker (repo-worker-code), lane B, queue task 5390.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…d check_bounds (#2595)

encode_entry writes the bound length as b.len() as u8 with no KEY_LEN
check: bounds of 73..=255 encoded into frames decode_frame itself
rejects, and bounds >= 256 wrapped the length byte and garbled the
entry stream, while check_bounds approved them all.

Add one shared check_bound_len gate (error names the bound length and
the 72-byte KEY_LEN limit, following the decoder wording in
Reader::entry) called from frames() per entry and from check_bounds()
per bound. Tests cover 72 (round-trips through a frame) and
73/100/255/256/300 (refused at both gates, no wrap).
@dezren39
dezren39 requested a review from a team as a code owner November 1, 2026 09:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T09:48:28.257682Z 751bc30 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ea0d7e60-f6ab-4982-9a86-6ea4fd6544fb
Commits

Reviewing files that changed from the base of the PR and between 199d9f2 and 751bc30.

Files selected for processing: 1
  • pkgs/id/src/event_store/range.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant